package com.pangu.message.constant;

import com.alibaba.fastjson.serializer.JSONSerializable;
import com.alibaba.fastjson.serializer.JSONSerializer;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.io.IOException;
import java.lang.reflect.Type;

/**
 * @author Linbizhao
 * @description: 消息大类
 * @since 2023/11/23 15:43
 */
@Getter
@AllArgsConstructor
public enum MessageCategory implements JSONSerializable {

    UNKNOWN("unKnown"),

    // 事件
    EVENT("event"),

    //其他
    OTHER("other"),
    ;

    /**
     * 消息大类名称
     */
    private final String value;

    @Override
    public void write(JSONSerializer serializer, Object fieldName, Type fieldType, int features) throws IOException {
        serializer.write(value);
    }
}
